package com.wangzh.nio.object;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class Demo {

    public static void main(String[] args) throws IOException {
        Student student = new Student("ads",1);

        ObjectOutputStream oo = new ObjectOutputStream(new FileOutputStream("objecta.txt"));

        oo.writeObject(student);

        System.out.println();
        oo.close();
    }
}
